package com.hzqy.persistence.dao.warn;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Repository;

import com.hzqy.persistence.dao.core.PersistenceDao;
import com.hzqy.web.vo.CmCatalogContentVo;
import com.hzqy.web.vo.CmCatalogVo;
import com.hzqy.web.vo.CmContentCastVo;
import com.hzqy.web.vo.CmContentOrgVo;
import com.hzqy.web.vo.CmContentVo;
import com.hzqy.web.vo.CmSeriesVo;
import com.hzqy.web.vo.PmsOrgVo;
import com.hzqy.web.vo.SysWarnVo;
import com.hzqy.web.vo.content.CmContentLedgerVo;

@Repository
public class WarnDao extends PersistenceDao<SysWarnVo, Integer>{
	protected final Logger LOG = LoggerFactory.getLogger(getClass());
	
	public int selectSysWarnCount(SysWarnVo sysWarnVo) {
		String namespace = this.getNamespace();
		return getSqlSession().selectOne(namespace + "selectSysWarnCount", sysWarnVo);
	}
	
	public List<SysWarnVo> selectSysWarnList(Map<String,Object> map){
		String namespace = this.getNamespace();
		return getSqlSession().selectList(namespace + "selectSysWarnList", map);
	}
	public SysWarnVo selectSysWarn(String f_sw_id){
		String namespace = this.getNamespace();
		return getSqlSession().selectOne(namespace + "selectSysWarn", f_sw_id);
	}
	
	public int deleteSysWarn(String f_sw_id) {
		String namespace = this.getNamespace();
		return getSqlSession().update(namespace + "deleteSysWarn", f_sw_id);
	}
	
	public int insertSysWarn(SysWarnVo sysWarnVo) {
		return getSqlSession().insert(this.getNamespace() + "insertSysWarn", sysWarnVo);
	}
	
	public int updateSysWarn(SysWarnVo sysWarnVo) {
		return getSqlSession().update(this.getNamespace() + "updateSysWarn", sysWarnVo);
	}
	
	public int reviewSysWarn(SysWarnVo sysWarnVo) {
		return getSqlSession().update(this.getNamespace() + "reviewSysWarn",sysWarnVo);
	}
	public int updateSysWarnStatus(String f_sw_id,String f_sw_status) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("f_sw_id", f_sw_id);
		map.put("f_sw_status", f_sw_status);
		return getSqlSession().update(this.getNamespace() + "updateSysWarnStatus", map);
	}
	
}
